package com.headwind.logistics.report.service.impl;

import com.headwind.logistics.report.dto.CityOwnerdto;
import com.headwind.logistics.report.mapper.CityMapper;
import com.headwind.logistics.report.service.inter.CityServiceInter;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author Administrator
 * @Date 2020/7/24 0024 17:16
 * @Version 1.0
 * @DESCRIPTION
        */
@Service

 class CityServiceImpl implements CityServiceInter {
    //访问数据访问层
    @Resource
    CityMapper cityMapper;

    @Override
    /**
     * 查询所有货主信息
     */
    public List<CityOwnerdto> queryAllCityOwnerdto(Integer page, Integer rows) {
        if (page != null){
            page = (page-1)*rows;
        }

        return cityMapper.queryAllCityOwnerdto(page,rows);
    }

    /**
     * 查询所有
     * @return
     */
    @Override
    public int cityOwnerdtoss() {
        return cityMapper.cityOwnerdtoss();
    }

    /**
     * g根据ID删除
     * @param id
     * @return
     */
    @Override
    public int deleteOwner(int id) {

         int cout =  cityMapper.deleteOwner(id);

         return cout;
    }

    /**
     * 新增
     * @param cityOwnerdto
     * @return
     */
    @Override
    public int addOwner(CityOwnerdto cityOwnerdto) {
        return cityMapper.addOwner(cityOwnerdto);
    }

    /**
     * 修改货主信息
     * @param cityOwnerdto
     * @return
     */
    @Override
    public int updateOwner(CityOwnerdto cityOwnerdto) {
        return cityMapper.updateOwner(cityOwnerdto);
    }


}
